Part Number Hot Search : 
DBB08G MB89F202 PDTD123E 120CA ZTX712 E5166A AO4262E LF201
Product Description
Full Text Search
 

To Download AP703000-B04 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 User's Manual
SAP703000-B04, SAP70732-B04
ADPCM middleware
Target device SAP703000-B04 : V850 familyTM SAP70732-B04 : V810 familyTM
Document No. U11381EJ2V0UM00 (2nd edition) Date Published July 1998 N CP(K) Printed in Japan
(c)
Printed in Japan
1996
[MEMO]
2
V810 Family, V850 Family, V810, V821, V850/SA1, V852, V853, and V854 are trademarks of NEC Corp. Green Hills Software is a trademark of Green Hills Software, Inc. PC DOS is a trademark of IBM Corp. Windows and MS-DOS are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. UNIX is a registered trademark licensed by X/Open Company Limited in the US and other countries. SUN4 is a trademark of Sun Microsystems, Inc.
The information in this document is subject to change without notice. No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Corporation. NEC Corporation assumes no responsibility for any errors which may appear in this document. NEC Corporation does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from use of a device described herein or any other liability arising from use of such device. No license, either express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of NEC Corporation or of others.
M7A 96.10
3
Regional Information
Some information contained in this document may vary from country to country. Before using any NEC product in your application, please contact the NEC office in your country to obtain a list of authorized representatives and distributors. They will verify: * Device availability * Ordering information * Product release schedule * Availability of related technical literature * Development environment specifications (for example, specifications for third-party tools and components, host computers, power plugs, AC supply voltages, and so forth) * Network requirements In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from country to country.
NEC Electronics Inc. (U.S.)
Santa Clara, California Tel: 408-588-6000 800-366-9782 Fax: 408-588-6130 800-729-9288
NEC Electronics (Germany) GmbH
Benelux Office Eindhoven, The Netherlands Tel: 040-2445845 Fax: 040-2444580
NEC Electronics Hong Kong Ltd.
Hong Kong Tel: 2886-9318 Fax: 2886-9022/9044
NEC Electronics Hong Kong Ltd. NEC Electronics (France) S.A.
Velizy-Villacoublay, France Tel: 01-30-67 58 00 Fax: 01-30-67 58 99 Seoul Branch Seoul, Korea Tel: 02-528-0303 Fax: 02-528-4411
NEC Electronics (Germany) GmbH
Duesseldorf, Germany Tel: 0211-65 03 02 Fax: 0211-65 03 490
NEC Electronics (France) S.A. NEC Electronics (UK) Ltd.
Milton Keynes, UK Tel: 01908-691-133 Fax: 01908-670-290 Spain Office Madrid, Spain Tel: 01-504-2787 Fax: 01-504-2860
NEC Electronics Singapore Pte. Ltd.
United Square, Singapore 1130 Tel: 65-253-8311 Fax: 65-250-3583
NEC Electronics Taiwan Ltd. NEC Electronics Italiana s.r.1.
Milano, Italy Tel: 02-66 75 41 Fax: 02-66 75 42 99
NEC Electronics (Germany) GmbH
Scandinavia Office Taeby, Sweden Tel: 08-63 80 820 Fax: 08-63 80 388
Taipei, Taiwan Tel: 02-719-2377 Fax: 02-719-5951
NEC do Brasil S.A.
Cumbica-Guarulhos-SP, Brasil Tel: 011-6465-6810 Fax: 011-6465-6829
J98. 2
4
MAJOR REVISIONS IN THIS EDITION
Page p.20 p.21 p.43 p.43 p.44 p.45 p.46 p.47 p.49
Contents Change of 1.3.2 (3) Supported tools Change of 1.3.4 Directory configuration Change of 3.1.1 V810 family Change of 3.1.2 V850 family Change of 3.1.3 Directory and file Change of 3.2.1 UNIX version Change of 3.2.2 MS-DOS/PC DOS version Change of 3.3 Creating Sample Program Change of APPENDIX SOURCE PROGRAM OF sample.c
The mark
shows major revised points.
5
[MEMO]
6
PREFACE
Readers
This manual is intended for user engineers who wish to design and develop application systems using the V810 family/V850 family .
Purpose
The purpose of this manual is to help user engineers understand the middleware that supports the design and development V810 family/V850 family application systems.
Organization
This manual contains the following items: * General * Library specification * Installation * Appendix
How to read this manual
It is assumed that the readers of this manual have a general knowledge of electrical engineering, logic circuits, microcomputers, and the C language. To understand the hardware functions of the V810 family/V850 family Refer to the user's manuals (hardware) of each product. To understand the instruction functions of the V810 family/V850 family Refer to the user's manuals (architecture) of each product.
Legend
Data significance Active low Note Caution Remark Numeric notation
: Most-significant digit on left, least-significant digit on right : xxx (bar over pin and signal names) : Description of : Supplement : Binary Decimal ... xxxx or xxxxB ... xxxx
Note
Memory map address: Top-low, bottom-high in the text : Important information
Hexadecimal ... xxxxH or 0x xxxx Prefix indicating power of 2 (address space, memory capacity) K (kilo) = 210 = 1024 M (mega) = 220 = 10242 G (giga) = 230 = 10243
7
Related documents
Some of the related documents listed below are preliminary versions but not so specified here. Documents related to V810 family
Product Name Nickname V810TM V821TM Device Name Data Sheet User's Manual Hardware U10691E U11678E U10661E U10077E Architecture U10082E
PD70732 PD70741
Documents related to V850 family
Product Name Nickname V852TM Device Name Data Sheet User's Manual Hardware U11826E U11827E U10913E U10038E Architecture U10243E
PD703002 PD70P3002
V853TM
PD703003, 703003A, 703005A U12261E
PD70F3003 PD70F3003A, 70F3025A
V854TM
U12036E U13189E Planned Planned U12756E U12755E Planned Planned Planned Planned U12768E U11969E
PD703008 PD703008Y PD70F3008 PD70F3008Y PD703015 PD703015Y PD70F3017 PD70F3017Y
V850/SA1TM
8
Document related to V810 family development tools (user's manual)
Document Name CA732 (C compiler) Operation Operation (UNIXTM based) based) Document Number U11013E U11068E U11016E U11010E U10346E U10347E U10490E
(WindowsTM
Assembly language C language RX732 (Real-time OS) Fundamental Nucleus installation Technical
Documents related to V850 family development tools (user's manual)
Document Name Document Number
IE-703002-MC (In-circuit emulator for V851, V852, V853, V854, V850/SA1) U11595E IE-703003-MC-EM1 (In-circuit emulator option board for V853) IE-703008-MC-EM1 (In-circuit emulator option board for V854) IE-703017-MC-EM1 (In-circuit emulator option board for V850/SA1) CA850 (C compiler) Operation (UNIX based) Operation (Windows based) C language Assembly language Project manager (Windows based) ID850 (C source debugger) Operation (Windows based) Installation (UNIX based) RX850 (real-time OS) Fundamental Technical Nucleus installation Installation (UNIX based) Installation (Windows based) Debugger (Windows based) AZ850 (system performance analyzer) - operation U11596E U12420E U12898E U12839E U12827E U12840E U10543E U11991E U11196E U12210E U12861E U13002E U11038E U12863E U12862E U11158E U11181E
For inquiries about the tools produced by Green Hills SoftwareTM, Inc. (GHS), please contact: Green Hills Software, Inc. 510 Castillo Street, Santa Barbara, California 93101 Tel: 805-965-6044 Web site: http://www.ghs.com
9
[MEMO]
10
CONTENTS
CHAPTER 1 GENERAL ........................................................................................................................ 15 1.1 1.2 Middleware ....................................................................................................................... 15 ADPCM ............................................................................................................................. 15
1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 PCM-to-linear conversion block ............................................................................................ ADPCM compression block .................................................................................................. ADPCM expansion block ...................................................................................................... Linear-to-PCM conversion block ........................................................................................... Synchronous coding correction block ................................................................................... Features ................................................................................................................................ Operating environment ......................................................................................................... Performance .......................................................................................................................... Directory configuration .......................................................................................................... 17 17 18 18 18 19 19 20 21
1.3
Product Outline ................................................................................................................ 19
1.3.1 1.3.2 1.3.3 1.3.4
CHAPTER 2 LIBRARY SPECIFICATIONS ........................................................................................... 23 2.1 Function ........................................................................................................................... 23
2.1.1 2.1.2 Compression processing ...................................................................................................... Expansion processing ........................................................................................................... 23 24
2.2 2.3
RAM .................................................................................................................................. 25 Data Type ......................................................................................................................... 25
2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 int pcm_mlaw ........................................................................................................................ int pcm_alaw ......................................................................................................................... int linear_enc ......................................................................................................................... int linear_dec ......................................................................................................................... int adpcm_32kbps ................................................................................................................. int adpcm_16kbps ................................................................................................................. 25 25 26 26 26 26
2.4 2.5
Error Processing ............................................................................................................. 27 Function Specifications .................................................................................................. 27
2.5.1 2.5.2 2.5.3 Initialization function .............................................................................................................. Compression function ........................................................................................................... Expansion function ................................................................................................................ 27 28 34
CHAPTER 3 INSTALLATION ............................................................................................................... 43 3.1 Supply Format ................................................................................................................. 43
3.1.1 3.1.2 3.1.3 V810 family ........................................................................................................................... V850 family ........................................................................................................................... Directory and file ................................................................................................................... UNIX version ......................................................................................................................... MS-DOS/PC DOS version .................................................................................................... 43 43 44 45 46
3.2
File Expansion to Host Machine .................................................................................... 45
3.2.1 3.2.2
3.3
Creating Sample Program .............................................................................................. 47
11
3.4 3.5
Changing Location .......................................................................................................... 48 Symbol Name Convention .............................................................................................. 48
APPENDIX SOURCE PROGRAM OF sample.c .................................................................................. 49
12
LIST OF FIGURES
Figure No. 1-1 1-2 1-3 1-4 1-5 2-1 2-2 3-1
Title
Page 15 16 16 17 18 23 24 47
Recommendation G.726 ................................................................................................................... Concept of ADPCM ........................................................................................................................... Organization of ADPCM Processing ................................................................................................. Organization of ADPCM Compression Block .................................................................................... Organization of ADPCM Expansion Block ........................................................................................ Compression Flow ............................................................................................................................ Expansion Processing Flow .............................................................................................................. Organization of Sample Program ......................................................................................................
13
LIST OF TABLES
Table No. 1-1 1-2 2-1 2-2
Title
Page 20 20 23 24
V810 Performance ............................................................................................................................ V853 Performance ............................................................................................................................ Compression Functions .................................................................................................................... Expansion Functions .........................................................................................................................
14
CHAPTER 1 GENERAL
This chapter explains the middleware and ADPCM decoder.
1.1 Middleware
Middleware is a software group tuned to draw out the full performance of a processor. Because many high-performance RISC processors are available today, the processing conventionally implemented by dedicated hardware can now be realized by a high-performance RISC processor and software. The software used for this purpose is called middleware. NEC supplies human-machine interface and signal processing technologies in the form of middleware. It provides excellent system solutions to satisfy the various needs of users. This ADPCM middleware is a library that compresses and expands speech code (telephone quality). Remark RISC: Reduced Instruction Set Computer
1.2 ADPCM
The ADPCM of this middleware codes speech in the analog telephone band (0.3 to 3.4 kHz) stipulated by ITUT Recommendation G.726. Recommendation G.726 was issued in 1990 by adding 40-kbps ADPCM, 24-kbps ADPCM, and 16-kbps ADPCM to Recommendation G.721 (32-kbps ADPCM) which was adopted as an international standard of telephone quality coding in 1988. This middleware supports the 32-kbps ADPCM and 16-kbps ADPCM of Recommendation G.726. Remark ADPCM: Adaptive Differential Pulse Code Modulation ITU-T: International Telecommunication Union-Telecommunication standardization sector Figure 1-1. Recommendation G.726
Recommendation G.726 Recommendation G.721 40-kbps ADPCM 32-kbps ADPCMNote 24-kbps ADPCM 16-kbps ADPCMNote
Note Supported by this middleware.
15
CHAPTER 1
GENERAL
The interface of ADPCM is based on the 64-kbps PCM code stipulated by ITU-T Recommendation G.711. This is because the 64-kbps PCM of Recommendation G.721 has been widely used as an international standard telephone quality coding method, and because ADPCM was developed as a standard to improve the compression rate. The 64-kbps PCM of ITU-T Recommendation G.711 limits the bandwidth to 0.3 to 3.4 kHz by using a bandpass filter and codes analog speech signals sampled at 8 kHz into 8-bit digital signals by means of non-linear quantization. The 64-kbps PCM has two modes: -law mode (used in Japan and North America) and A-law mode (used in Europe). ADPCM is a standard for further compressing the speech codes compressed by means of 64-kbps PCM. Figure 1-2. Concept of ADPCM
PCM code
Compression
ADPCM code
64 kbps : 8 kHz x 8 bits Expansion
32 kbps : 8 kHz x 4 bits 16 kbps : 8 kHz x 2 bits
The compression/expansion processing of ADPCM is described next. The compression processing of ADPCM is performed by a PCM-to-linear conversion block and an ADPCM compression block, as shown in Figure 1-3. The expansion processing of ADPCM is performed by an ADPCM expansion block, linear-to-PCM conversion block, and synchronous coding correction block, as shown in Figure 1-3. The expansion processing prevents degradation of the sound quality by repeatedly compressing and expanding speech data, by using the synchronous coding correction block, when incorporated to an existing digital (64-kbps PCM) communication network. Figure 1-3. Organization of ADPCM Processing
Compression processing 32 kbps : 4 bits 16 kbps : 2 bits
8 bits
PCM-to-linear conversion block
14 bits
ADPCM compression block
PCM code Internal variables
ADPCM code
8 bits
Synchronous coding correction block
8 bits
Linear-to-PCM conversion block
16 bits
ADPCM expansion block
Expansion processing
16
CHAPTER 1
GENERAL
1.2.1 PCM-to-linear conversion block This block converts a 64-kbps PCM code (8 bits) into a linear code (14 bits: expressed as 2's complement). The PCM code in the -law mode is converted by a PCM decoder conforming to Recommendation G.711. The PCM code in the A-law mode is converted by a PCM decoder conforming to Recommendation G.711. The resulting value is doubled and then adjusted to 14 bits. 1.2.2 ADPCM compression block This block compresses a linear code (14 bits) to an ADPCM code (32 kbps: 4 bits, 16 kbps: 2 bits) in the following procedure (refer to Figure 1-4): (1) A predicted signal is subtracted from the input signal (linear code) to calculate a differential signal. (2) The differential signal is coded by using an adaptive quantization unit. For 32-kbps ADPCM, the differential signal is coded to 4 bits by using a 15 level adaptive quantization unit. For 16-kbps ADPCM, the differential signal is coded to 2 bits by using a 4 level adaptive quantization unit. This coded signal is an ADPCM code and is the output of the compression processing. (3) An adaptive reverse quantization unit is used to generate a quantized differential signal from the ADPCM code. (4) The quantized differential signal is added to the predicted signal to reproduce the input signal. (5) An adaptive prediction unit is used to calculated the predicted value of the next input signal from the reproduced signal and quantized differential signal. Figure 1-4. Organization of ADPCM Compression Block
Linear code (14 bits)
+ - Predicted signal
+
Differential signal
Adaptive quantization unit 32 kbps : 15 levels 16 kbps : 4 levels
ADPCM code (32 kbps : 4 bits) (16 kbps : 2 bits)
Reproduced signal Adaptive prediction unit
+ + + Adaptive reverse quantization unit 32 kbps : 15 levels 16 kbps : 4 levels
Quantized differential signal
17
CHAPTER 1
GENERAL
1.2.3 ADPCM expansion block This block expands an ADPCM code (32 kbps: 4 bits, 16 kbps: 2 bits) to a reproduced linear code (16 bits) in the following procedure (refer to Figure 1-5): (1) A quantized differential signal is generated from the ADPCM code by using an adaptive reverse quantization unit. (2) The input signal is reproduced by adding the quantized differential signal to a predicted signal. This signal is the output signal of the ADPCM expansion processing. (3) An adaptive prediction unit is used to calculate the predicted value of the next input signal from the reproduced signal and quantized differential signal. Figure 1-5. Organization of ADPCM Expansion Block
ADPCM code (32 kbps : 4 bits) (16 kbps : 2 bits)
Quantized Reproduced Adaptive reverse + signal quantization unit differential signal + 32 kbps : 15 levels 16 kbps : 4 levels + Predicted signal
Reproduced linear code (16 bits)
Adaptive prediction unit
1.2.4 Linear-to-PCM conversion block This block converts a reproduced linear code (16 bits) to a 64-kbps PCM code (8 bits). The PCM code in the -law mode is converted by a PCM coder conforming to Recommendation G.711. The PCM code in the A-law mode is converted by a PCM coder conforming to Recommendation G.711 after the reproduced linear code has been adjusted (1/2) 1.2.5 Synchronous coding correction block The synchronous coding block corrects for cumulative distortion that may take place when compression from PCM to ADPCM and expansion from ADPCM to PCM (synchronous tandem coding) are repeatedly performed. The value of the reproduced linear code, which is the input signal, is corrected by simulating the ADPCM code to be compressed next by using the PCM-to-linear conversion block described in 1.2.1 and in steps (1) and (2) described in 1.2.2 ADPCM compression block, so that the value of the reproduced linear code is the same as that of the current ADPCM code.
18
CHAPTER 1
GENERAL
1.3 Product Outline
1.3.1 Features Conforms to the international ADPCM standard (ITU-T Recommendation G.726). (1) Bit rate The following two bit rates are supported: * 32-kbps ADPCM (compresses 1 sampling data to 4 bits) * 16-kbps ADPCM (compresses 1 sampling data to 2 bits) (2) 64 kbps PCM code interface The following two modes conforming to the international 64-kbps PCM standard (ITU-T Recommendation G.711) are supported: * -law mode * A-law mode If synchronous tandem coding is not performed for expansion, a mode in which the synchronous coding correction function is deleted from the ITU-T Recommendation G.726, with increased execution speed, is supported. (3) Linear code interface A liner code interface that deletes the functions (mutual conversion of 64 kbps PCM code and linear code and synchronous coding correction) that are related to the 64-kbps PCM code interface and that can be deleted from the international standard of ADPCM (ITU-T Recommendation G.726) is supported. Remark The linear code interface does not support synchronous tandem coding. 1.3.2 Operating environment (1) Target CPU * V810 family * V850 family (2) Necessary memory * ROM: total capacity of 9K bytes or less (The capacity varies depending on the functions to be linked.) * RAM: 80 bytes max.
19
CHAPTER 1
GENERAL
(3) Supported tools (a) V810 family * NEC C compiler package: CA732 (Windows 3.1 or above, SUN4TM) * GHS C compiler/assembler: C-V810 (Windows 3.1 or above, SUN4) (b) V850 family * NEC C compiler package: CA850 (Windows 3.1 or above, SUN4) * GHS C compiler/assembler: C-V850 (Windows 3.1 or above, SUN4) 1.3.3 Performance The processing time per sampling data is shown below. (1) V810 [Condition] 25 MHz, 32-bit bus, cache OFF, 0 wait ROM/RAM Table 1-1. V810 Performance Compression/Expansion Compression Linear code interface PCM code interface Expansion Linear code interface (synchronous tandem coding not supported) PCM code interface (synchronous tandem coding not supported) PCM code interface 66 s max. 61 s max. Processing Time 62 s max. 63 s max. 59 s max.
(2) V853 [Condition] 33 MHz, internal ROM/RAM, 0 wait, external RAM (speech data) Table 1-2. V853 Performance Compression/Expansion Compression Linear code interface PCM code interface Expansion Linear code interface (synchronous tandem coding not supported) PCM code interface (synchronous tandem coding not supported) PCM code interface 31 s max. 29 s max. Processing Time 29 s max. 30 s max. 28 s max.
20
CHAPTER 1
GENERAL
1.3.4 Directory configuration The directory configuration of the middleware library ADPCM is as follows: (1) V810 family (software version: Ver. 1.00) ./ nectools lib810 smp810 adpcm libadpcm. a sample. c makefile linear o expect_e.o expect_d.o ghstools lib810 smp810 adpcm libadpcm.a sample.c makefile linear.o expect_e.o expect_d.o (2) V850 family (software version: Ver. 1.01) ./ nectools lib850 smp850 adpcm libadpcm. a sample. c makefile linear.o expect_e.o expect_d.o startup.s sample.lnk ghstools lib850 smp850 adpcm libadpcm.a sample.c makefile linear.o expect_e.o expect_d.o startup.s dfile
21
[MEMO]
22
CHAPTER 2 LIBRARY SPECIFICATIONS
2.1 Function
2.1.1 Compression processing Speech data is compressed to ADPCM codes of 32 kbps or 16 kbps. The speech data which is input is classified according to functions corresponding to linear codes and 64-kbps PCM codes (-law, A-law). Table 2-1. Compression Functions Function Classification adpcm_132_enc ( ) adpcm_pm32_enc ( ) adpcm_pa32_enc ( ) adpcm_I16_enc ( ) adpcm_pm16_enc ( ) adpcm_pa16_enc ( ) Input Data Type Compressed Data Type Linear code 32-kbps ADPCM
64-kbps PCM code (-law) 32-kbps ADPCM 64-kbps PCM code (A-law) 32-kbps ADPCM Linear code 16-kbps ADPCM
64-kbps PCM code (-law) 16-kbps ADPCM 64-kbps PCM code (A-law) 16-kbps ADPCM
Figure 2-1. Compression Flow
Start
ADPCM initialization
Input of speech data
Library sections
ADPCM compression
Storage of compressed data
No
End ? Yes End
23
CHAPTER 2
LIBRARY SPECIFICATIONS
2.1.2 Expansion processing Compressed data (ADPCM codes of 32 kbps or 16 kbps) is expanded to speech data. The speech data which is output is classified according to functions corresponding to linear codes and 64-kbps PCM codes (-law, A-law). Table 2-2. Expansion Functions Function Classification adpcm_l32_dec ( ) adpcm_pm32_dec ( ) adpcm_pa32_dec ( ) adpcm_tpm32_dec ( )Note Compressed Data Type Output Data Type 32-kbps ADPCM 32-kbps ADPCM 32-kbps ADPCM 32-kbps ADPCM 32-kbps ADPCM 64-kbps ADPCM 16-kbps ADPCM 16-kbps ADPCM 16-kbps ADPCM 16-kbps ADPCM linear code 64-kbps PCM code (-law) 64-kbps PCM code (A-law) 64-kbps PCM code (-law) 64-kbps PCM code (A-law) linear code 64-kbps PCM code (-law) 64-kbps PCM code (A-law) 64-kbps PCM code (-law) 64-kbps PCM code (A-law)
adpcm_tpa32_dec ( )Note adpcm_I16_dec ( ) adpcm_pm16_dec ( ) adpcm_pa16_dec ( ) adpcm_tpm16_dec ( )Note adpcm_tpa16_dec ( )Note
Note These functions support tandem synchronous coding. Figure 2-2. Expansion Processing Flow
Start
ADPCM initialization
Reads compressed data
Library sections
ADPCM expansion
Outputs expanded data
No
End ? Yes End
24
CHAPTER 2
LIBRARY SPECIFICATIONS
2.2 RAM
Be sure to secure the determined memory capacity (resident area) for each of the compression and expansion processing with this library. To secure the resident area, perform the following in the user application: int work[16] Manage the resident area in the user application, and specify a pointer (first address) with the input parameter of the compression/expansion function. Do not destroy the contents of the resident area until the compression/ expansion processing sequence is completed. The operation is not guaranteed if the resident area is destroyed. This library also uses the following stack area for the compression/expansion functions: * V810 family version: 3 words (12 bytes) * V850 family version: 2 words (8 bytes)
2.3 Data Type
This section describes the data used with this library. Each data type is standardized to int width (32 bits) to increase the processing speed. Note that the valid range is not checked in each function. 2.3.1 int pcm_mlaw [Contents] 64-kbps PCM code (-law) [Description] 8-bit data (Zero-extend up to bit 31.) [Valid range] 0 to 255
31
24 23
16 15
87
0
000000000000000000000000 Zero extension
2.3.2 int pcm_alaw [Contents] 64-kbps PCM code (A-law) [Description] 8-bit data (Zero-extend up to bit 31.) [Valid range] 0 to 255
31
24 23
16 15
87
0
000000000000000000000000 Zero extension
25
CHAPTER 2
LIBRARY SPECIFICATIONS
2.3.3 int linear_enc [Contents] Linear code (compression processing argument) [Description] 14-bit data (expressed as 2's complement. Sign-extend up to bit 31.) [Valid range] -8192 to 8191
31
24 23
16 15
87
0
Sign extension
2.3.4 int linear_dec [Contents] Linear code (expansion processing return value) [Description] 16-bit data (expressed as 2's complement. Sign-extended up to bit 31) [Valid range] -32768 to 32767
31
24 23
16 15
87
0
Sign extension
2.3.5 int adpcm_32kbps [Contents] 32-kbps ADPCM code [Description] 4-bit data (Zero-extend up to bit 31.) [Valid range] 1 to 15
31
24 23
16 15
87
0
0000000000000000000000000000 Zero extension
2.3.6 int adpcm_16kbps [Contents] 16-kbps ADPCM code [Description] 2-bit data (Zero-extend up to bit 31.) [Valid range] 0 to 3
31
24 23
16 15
87
0
000000000000000000000000000000 Zero extension
26
CHAPTER 2
LIBRARY SPECIFICATIONS
2.4 Error Processing
The functions of the ADPCM library do not have an error processing functions like outputting an error code as a return value. This is because the value outside the valid range in the middle of calculation is limited (saturated) by the Recommendation and therefore, errors do not exist. However, errors, such as NMI, may occur. If these errors occur, deal with them in the user application by managing flags before and after function calls.
2.5 Function Specifications
The ADPCM library supplies a total of 17 functions including an initialization function, six compression (encoder) functions, and 10 expansion (decoder) functions. These functions are described next. 2.5.1 Initialization function (1) adpcm_init function This function initializes the encoder and decoder. Secure a resident area (64 bytes) for the processing of the encoder and decoder in the application program, and use the addresses of that area as arguments. Be sure to call the adpcm_init function before performing an encoder/decoder processing sequence. [Classification] [Outline] [Format] [Argument] ADPCM initialization (common to encoder and decoder) Initializes the resident area of the ADPCM encoder and decoder. void adpcm_init (init *work); Type int Argument Description First address of resident area (64 bytes)
[Function name] adpcm_init
work [16]
[Return value] [Feature]
None Initializes the resident area for the encode and decode processing.
Caution After calling the adpcm_init function, do not destroy the resident RAM area until the encode and decode processing sequence is completed. If the resident area is destroyed, the operation is not guaranteed.
27
CHAPTER 2
LIBRARY SPECIFICATIONS
2.5.2 Compression function (1) adpcm_I32_enc function This function performs 32-kbps ADPCM encode processing of the linear code interface. It encodes a linear code given by the input parameter, and returns a 32-kbps ADPCM code as a return value. Of the parameters to be passed to the adpcm_I32_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [Classification] [Outline] [Format] [Argument] 32-kbps ADPCM encode processing (linear code interface) Encodes a specified linear code to a 32-kbps ADPCM code. int adpcm_I32_enc (int linear_enc, int *work) Type int int Argument Description First address of resident area (64 bytes) Linear code
[Function name] adpcm_I32_enc
work [16]
linear_enc
[Return value]
Type int
Return Value adpcm_32 32-kbps ADPCM code
Description
[Feature] [Remark]
Encodes sampling data given by a linear code to a 32-kbps ADPCM code. The following function is deleted from the 32-kbps ADPCM encoder of ITU-T Recommendation. * Conversion from 64-kbps PCM code to linear code
28
CHAPTER 2
LIBRARY SPECIFICATIONS
(2) adpcm_pm32_enc function This function performs 32-kbps ADPCM encode processing of the -law PCM code interface. It encodes a 64-kbps -law PCM code given by the input parameter, and returns a 32-kbps ADPCM code as a return value. Of the parameters to be passed to the adpcm_pm32_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [Classification] [Outline] [Format] [Argument] 32-kbps ADPCM encode processing (-law PCM code interface) Encodes a specified 64-kbps -law PCM code to a 32-kbps ADPCM code. int adpcm_pm32_enc (int pcm_mlaw, int *work) Type int int Argument Description First address of resident area (64 bytes) 64-kbps -law PCM
[Function name] adpcm_pm32_enc
work [16]
pcm_mlaw
[Return value]
Type int
Return Value adpcm_32 32-kbps ADPCM code
Description
[Feature]
Encodes sampling data given by a 64-kbps -law PCM code to a 32-kbps ADPCM code.
29
CHAPTER 2
LIBRARY SPECIFICATIONS
(3) adpcm_pa32_enc function This function performs 32-kbps ADPCM encode processing of the A-law PCM code interface. It encodes a 64-kbps A-law PCM code given by the input parameter, and returns a 32-kbps ADPCM code as a return value. Of the parameters to be passed to the adpcm_pa32_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [Classification] [Outline] [Format] [Argument] 32-kbps ADPCM encode processing (A-law PCM code interface) Encodes a specified a 64-kbps A-law PCM code to a 32-kbps ADPCM code. int adpcm_pa32_enc (int pcm_alaw, int *work) Type int int Argument Description First address of resident area (64 bytes) 64-kbps A-law PCM code
[Function name] adpcm_pa32_enc
work [16]
pcm_alaw
[Return value]
Type int
Return Value adpcm_32 32-kbps ADPCM code
Description
[Feature]
Encodes sampling data given by a 64-kbps A-law code to a 32-kbps ADPCM code.
30
CHAPTER 2
LIBRARY SPECIFICATIONS
(4) adpcm_I16_enc function This function performs 16-kbps ADPCM encode processing of the linear code interface. It encodes a linear code given by the input parameter, and returns a 16-kbps ADPCM code as a return value. Of the parameters to be passed to the adpcm_I16_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [Classification] [Outline] [Format] [Argument] 16-kbps ADPCM encode processing (A-law PCM code interface) Encodes a specified linear code to a 32-kbps ADPCM code. int adpcm_I16_enc (int pcm_alaw, int *work) Type int int Argument Description First address of resident area (64 bytes) Linear code
[Function name] adpcm_I16_enc
work [16]
linear_enc
[Return value]
Type int
Return Value adpcm_16 16-kbps ADPCM code
Description
[Feature] [Remark]
Encodes sampling data given by a linear code to a 16-kbps ADPCM code. The following function is deleted from the 16-kbps ADPCM encoder of ITU-T Recommendation. * Conversion from 64-kbps PCM code to linear code
31
CHAPTER 2
LIBRARY SPECIFICATIONS
(5) adpcm_pm16_enc function This function performs 16-kbps ADPCM encode processing of the -law PCM code interface. It encodes a 64-kbps -law PCM code given by the input parameter, and returns a 16-kbps ADPCM code as a return value. Of the parameters to be passed to the adpcm_pm16_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [Classification] [Outline] [Format] [Argument] 16-kbps ADPCM encode processing (-law PCM code interface) Encodes a specified a 64-kbps -law PCM code to a 16-kbps ADPCM code. int adpcm_pm16_enc (int pcm_mlaw, int *work) Type int int Argument Description First address of resident area (64 bytes) 64-kbps -law PCM code
[Function name] adpcm_pm16_enc
work [16]
pcm_mlaw
[Return value]
Type int
Return Value adpcm_16 16-kbps ADPCM code
Description
[Feature]
Encodes sampling data given by a 64-kbps -law PCM code to a 16-kbps ADPCM code.
32
CHAPTER 2
LIBRARY SPECIFICATIONS
(6) adpcm_pa16_enc function This function performs 16-kbps ADPCM encode processing of the A-law PCM code interface. It encodes a 64-kbps A-law PCM code given by the input parameter, and returns a 16-kbps ADPCM code as a return value. Of the parameters to be passed to the adpcm_pa16_enc function, specify the same address as that passed to the adpcm_init function as the address of the resident area for encode processing. [Classification] [Outline] [Format] [Argument] 16-kbps ADPCM encode processing (A-law PCM code interface) Encodes a specified a 64-kbps A-law PCM code to a 16-kbps ADPCM code. int adpcm_pa16_enc (int pcm_alaw, int *work) Type int int Argument Description First address of resident area (64 bytes) 64-kbps A-law PCM code
[Function name] adpcm_pa16_enc
work [16]
pcm_alaw
[Return value]
Type int
Return Value adpcm_16 16-kbps ADPCM code
Description
[Feature]
Encodes sampling data given by a 64-kbps A-law PCM code to a 16-kbps ADPCM code.
33
CHAPTER 2
LIBRARY SPECIFICATIONS
2.5.3 Expansion function (1) adpcm_I32_dec function This function performs 32-kbps ADPCM decode processing of the linear code interface. It decodes a 32-kbps ADPCM code given by the input parameter, and returns a linear code as a return value. Of the parameters to be passed to the adpcm_I32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 32-kbps ADPCM decode processing (linear code interface) Decodes a specified 32-kbps ADPCM code to a linear code. int adpcm_I32_dec (int adpcm-32, int *work) Type int int Argument Description First address of resident area (64 bytes) 32-kbps ADPCM code
[Function name] adpcm_I32_dec
work [16]
adpcm-32
[Return value]
Type int
Return Value linear_dec Linear code
Description
[Feature] [Remark]
Decodes sampling data given by a 32-kbps ADPCM code to a linear code. The following function is deleted from the 32-kbps ADPCM decoder of ITU-T Recommendation. * Conversion from linear code to 64-kbps PCM code * Synchronous coding correction
34
CHAPTER 2
LIBRARY SPECIFICATIONS
(2) adpcm_pm32_dec function This function performs 32-kbps ADPCM decode processing of the -law PCM code interface. It decodes a 32-kbps ADPCM code given by the input parameter, and returns a 64-kbps -law PCM code as a return value. Of the parameters to be passed to the adpcm_pm32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 32-kbps ADPCM decode processing (-law PCM code interface) Decodes a specified a 32-kbps ADPCM code to a 64-kbps -law PCM code. int adpcm_pm32_dec (int adpcm-32, int *work) Type int int Argument Description First address of resident area (64 bytes) 32-kbps ADPCM code
[Function name] adpcm_pm32_dec
work [16]
adpcm_32
[Return value]
Type int
Return Value pcm_mlaw
Description 64-kbps -law PCM code
[Feature] [Remark]
Decodes sampling data given by a 32-kbps ADPCM code to a 64-kbps -law PCM code. The following function is deleted from the 32-kbps ADPCM decoder of ITU-T Recommendation. * Synchronous coding correction.
35
CHAPTER 2
LIBRARY SPECIFICATIONS
(3) adpcm_pa32_dec function This function performs 32-kbps ADPCM decode processing of the A-law PCM code interface. It decodes a 32-kbps ADPCM code given by the input parameter, and returns a 64-kbps A-law PCM code as a return value. Of the parameters to be passed to the adpcm_pa32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 32-kbps ADPCM decode processing (A-law PCM code interface) Decodes a specified a 32-kbps ADPCM code to a 64-kbps A-law PCM code. int adpcm_pa32_dec (int adpcm-32, int *work) Type int int Argument Description First address of resident area (64 bytes) 32-kbps ADPCM code
[Function name] adpcm_pa32_dec
work [16]
adpcm_32
[Return value]
Type int
Return Value pcm_alaw
Description 64-kbps A-law PCM code
[Feature] [Remark]
Decodes sampling data given by a 32-kbps ADPCM code to a 64-kbps A-law PCM code. The following function is deleted from the 32-kbps ADPCM decoder of ITU-T Recommendation. * Synchronous coding correction.
36
CHAPTER 2
LIBRARY SPECIFICATIONS
(4) adpcm_tpm32_dec function This function performs 32-kbps ADPCM decode processing of the -law PCM code interface. It decodes a 32-kbps ADPCM code given by the input parameter, and returns a 64-kbps -law PCM code as a return value. Of the parameters to be passed to the adpcm_tpm32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 32-kbps ADPCM decode processing (-law PCM code interface) Decodes a specified a 32-kbps ADPCM code to a 64-kbps -law PCM code. int adpcm_tpm32_dec (int adpcm-32, int *work) Type int int Argument Description First address of resident area (64 bytes) 32-kbps ADPCM code
[Function name] adpcm_tpm32_dec
work [16]
adpcm_32
[Return value]
Type int
Return Value pcm_mlaw
Description 64-kbps -law PCM code
[Feature]
Decodes sampling data given by a 32-kbps ADPCM code to a 64-kbps -law PCM code.
37
CHAPTER 2
LIBRARY SPECIFICATIONS
(5) adpcm_tpa32_dec function This function performs 32-kbps ADPCM decode processing of the A-law PCM code interface. It decodes a 32-kbps ADPCM code given by the input parameter, and returns a 64-kbps A-law PCM code as a return value. Of the parameters to be passed to the adpcm_tpa32_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 32-kbps ADPCM decode processing (A-law PCM code interface) Decodes a specified a 32-kbps ADPCM code to a 64-kbps A-law PCM code. int adpcm_tpa32_dec (int adpcm_32, int *work) Type int int Argument Description First address of resident area (64 bytes) 32-kbps ADPCM code
[Function name] adpcm_tpa32_dec
work [16]
adpcm_32
[Return value]
Type int
Return Value pcm_alaw
Description 64-kbps A-law PCM code
[Feature]
Decodes sampling data given by a 32-kbps ADPCM code to a 64-kbps A-law PCM code.
38
CHAPTER 2
LIBRARY SPECIFICATIONS
(6) adpcm_I16_dec function This function performs 16-kbps ADPCM decode processing of the linear code interface. It decodes a 16-kbps ADPCM code given by the input parameter, and returns a linear code as a return value. Of the parameters to be passed to the adpcm_I16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 16-kbps ADPCM decode processing (linear code interface) Decodes a specified a 16-kbps ADPCM code to a linear code. int adpcm_I16_dec (int adpcm_16, int *work) Type int int Argument Description First address of resident area (64 bytes) 16-kbps ADPCM code
[Function name] adpcm_I16_dec
work [16]
adpcm_16
[Return value]
Type int
Return Value linear_dec Linear code
Description
[Feature] [Remark]
Decodes sampling data given by a 16-kbps ADPCM code to a linear code. The following function is deleted from the 32-kbps ADPCM decoder of ITU-T Recommendation. * Conversion from linear code to 64-kbps PCM code. * Synchronous coding correction
39
CHAPTER 2
LIBRARY SPECIFICATIONS
(7) adpcm_pm16_dec function This function performs 16-kbps ADPCM decode processing of the -law PCM code interface. It decodes a 16-kbps ADPCM code given by the input parameter, and returns a 64-kbps -law PCM code as a return value. Of the parameters to be passed to the adpcm_pm16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 16-kbps ADPCM decode processing (-law PCM code interface) Decodes a specified 16-kbps ADPCM code to a -law PCM code. int adpcm_pm16_dec (int adpcm_16, int *work) Type int int Argument Description First address of resident area (64 bytes) 16-kbps ADPCM code
[Function name] adpcm_pm16_dec
work [16]
adpcm_16
[Return value]
Type int
Return Value pcm_mlaw
Description 64-kbps -law PCM code
[Feature] [Remark]
Decodes sampling data given by a 16-kbps ADPCM code to a 64-kbps -law PCM code. The following function is deleted from the 16-kbps ADPCM decoder of ITU-T Recommendation. * Synchronous coding correction
40
CHAPTER 2
LIBRARY SPECIFICATIONS
(8) adpcm_pa16_dec function This function performs 16-kbps ADPCM decode processing of the A-law PCM code interface. It decodes a 16-kbps ADPCM code given by the input parameter, and returns a 64-kbps A-law PCM code as a return value. Of the parameters to be passed to the adpcm_pa16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 16-kbps ADPCM decode processing (A-law PCM code interface) Decodes a specified 16-kbps ADPCM code to a 64-kbps A-law PCM code. int adpcm_pa16_dec (int adpcm_16, int *work) Type int int Argument Description First address of resident area (64 bytes) 16-kbps ADPCM code
[Function name] adpcm_pa16_dec
work [16]
adpcm_16
[Return value]
Type int
Return Value pcm_alaw
Description 64-kbps A-law PCM code
[Feature] [Remark]
Decodes sampling data given by a 16-kbps ADPCM code to a 64-kbps A-law PCM code. The following function is deleted from the 16-kbps ADPCM decoder of ITU-T Recommendation. * Synchronous coding correction
41
CHAPTER 2
LIBRARY SPECIFICATIONS
(9) adpcm_tpm16_dec function This function performs 16-kbps ADPCM decode processing of the -law PCM code interface. It decodes a 16-kbps ADPCM code given by the input parameter, and returns a 64-kbps -law PCM code as a return value. Of the parameters to be passed to the adpcm_tpm16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 16-kbps ADPCM decode processing (-law PCM code interface) Decodes a specified 16-kbps ADPCM code to a -law PCM code. int adpcm_tpm16_dec (int adpcm_16, int *work) Type int int Argument Description First address of resident area (64 bytes) 16-kbps ADPCM code
[Function name] adpcm_tpm16_dec
work [16]
adpcm_16
[Return value]
Type int
Return Value pcm_mlaw
Description 64-kbps -law PCM code
[Feature]
Decodes sampling data given by a 16-kbps ADPCM code to a 64-kbps -law PCM code.
(10) adpcm_tpa16_dec function This function performs 16-kbps ADPCM decode processing of the A-law PCM code interface. It decodes a 16-kbps ADPCM code given by the input parameter, and returns a 64-kbps A-law PCM code as a return value. Of the parameters to be passed to the adpcm_tpa16_dec function, specify the same address as that passed to the adpcm_init function as the address of the resident area for decode processing. [Classification] [Outline] [Format] [Argument] 16-kbps ADPCM decode processing (A-law PCM code interface) Decodes a specified 16-kbps ADPCM code to a 64-kbps A-law PCM code. int adpcm_tpa16_dec (int adpcm_16, int *work) Type int int Argument Description First address of resident area (64 bytes) 16-kbps ADPCM code
[Function name] adpcm_tpa16_dec
work [16]
adpcm_16
[Return value]
Type int
Return Value pcm_alaw
Description 64-kbps A-law PCM code
[Feature]
Decodes sampling data given by a 16-kbps ADPCM code to a 64-kbps A-law PCM code.
42
CHAPTER 3 INSTALLATION
3.1 Supply Format
The middleware library ADPCM is a library for developing applications using NEC or GHS tools. Therefore, it is available in two media, one for NEC tools and the other for GHS tools. The contents of the supply media are as follows: 3.1.1 V810 family ./ nectools lib810 smp810 adpcm libadpcm.a sample.c makefile linear.o expect_e.o expect_d.o ghstools lib810 smp810 adpcm libadpcm.a sample.c makefile linear.o expect_e.o expect_d.o 3.1.2 V850 family ./ nectools lib850 smp850 adpcm libadpcm.a sample.c makefile linear.o expect_e.o expect_d.o startup.s sample.lnk ghstools lib850 smp850 adpcm libadpcm.a sample.c makefile linear.o expect_e.o expect_d.o startup.s dfile
43
CHAPTER 3
INSTALLATION
3.1.3 Directory and file The functions of each directory and file are as follows: (1) nectools Contains the ADPCM program used to develop applications using NEC tools. (2) ghstools Contains the ADPCM program used to develop applications using GHS tools. (3) lib850 Contains the library of the ADPCM. (4) smp810/adpcm, smp850/adpcm Contains a sample program using the ADPCM and sample speech data.
44
CHAPTER 3
INSTALLATION
3.2 File Expansion to Host Machine
This section describes the procedure, for the UNIX version (SUN4) and MS-DOSTM/PC DOSTM version, to transfer the files from the supply media to the host machine. 3.2.1 UNIX version The UNIX version is available in two media: CGMT and 3.5" FD. The ADPCM files are stored in these media in the tar format. The procedure for installing ADPCM to the host machine is as follows. <1> Create a directory to install the ADPCM. In this example, a directory named mw_adpcm is created. % mkdir mw_adpcm <2> Move to the created directory. % cd mw_adpcm <3> Insert the supply media. * Insert the CGMT in the magnetic tape unit. * Insert the 3.5" FD in the floppy disk drive. <4> Execute the tar command to expand the files on disk. The special file name to be specified differs depending on the host machine. In this example, only the files for NEC tools are expanded, assuming that the special file name is /dev/rst8. % tar -xvof /dev/rst8 nectools To expand the files for GHS tools, input the following: % tar -xvof /dev/rst8 ghstools <5> Confirm that the files have been installed. For each directory, refer to 3.1 Supply Format. % ls -CFR
45
CHAPTER 3
INSTALLATION
3.2.2 MS-DOS/PC DOS version The MS-DOS/PC DOS version is supplied on a 3.5" FD. Install the ADPCM on the host machine in the following procedure: <1> Create a directory to which the ADPCM is to be installed. In this example, a directory named mw_adpcm is created in drive A. A> md mw_adpcm <2> Move to the created directory. A> cd mw_adpcm <3> Insert the supply media in the floppy disk drive. In this example, insert the disk in drive C. <4> Execute the xcopy command to expand the files. In this example, only the files for NEC tools are expanded. A> xcopy c: \nectools . /s /e /v Similarly, expand the files for GHS tools as follows: A> xcopy c: \ghstools . /s /e /v <5> Confirm that the files have been installed. For each directory, refer to 3.1 Supply Format. A> dir a: \nectools
46
CHAPTER 3
INSTALLATION
3.3 Creating Sample Program
The directory smp810 (V810 family version) or smp850 (V850 family version) stores a sample program using the compression function and expansion function of 32 kbps ADPCM (linear code interface) and speech data (refer to APPENDIX for the source program of sample.c). The sample program compresses a data array called linear_enc stored in the file linear.o, and the result of compression is stored in an array called adpcm_32. Next, this compressed data is expanded and the result of decoding (expansion) is stored in an array called linear_dec. Figure 3-1. Organization of Sample Program
7 cnt=1 cnt=2 cnt=3 cnt=4 cnt=5 cnt=6 Compression cnt=2 cnt=4 cnt=6
43 cnt=1 cnt=3 cnt=5
0 (Bit) Expansion cnt=1 cnt=2 cnt=3 cnt=4 cnt=5 cnt=6
unsigned char adpcm_32 [cnt]
short linear_enc [cnt] (linear.o)
short linear_dec [cnt]
In the example given below, sample program "make", NEC tools, and UNIX version are used. <1> Move to the directory containing the sample program. % cd mw_adpcm/nectools/smp810/adpcm <2> Change startup.c in accordance with the target, by using an editor. startup.c supplied as a sample describes only initialization of the stack pointer. <3> Execute the make command to create sample.elf % make sample.elf <4> Confirm that sample.elf has been created. % ls - l sample.elf <5> Download the sample program to the target using an in-circuit emulator and execute it.
47
CHAPTER 3
INSTALLATION
3.4 Changing Location
The ADPCM library is given the following section name. The location can be changed in accordance with the user's target.
Section Name .ad_text .ad_data Type .text .data Description Text (instruction code) Table data (constant)
3.5 Symbol Name Convention
The symbol names used in the ADPCM library are in compliance with the following convention. When using the symbol names in combination with other applications, be careful not to duplicate them. Classification Function/symbol Convention "adpcm_" is prefixed.
48
APPENDIX SOURCE PROGRAM OF sample.c
--- sample.c--extern short linear_enc[0x4000]; unsigned char adpcm_32[0x4000/2]; short linear_dec[0x4000];
int work[16];
void encoder () { unsigned register int cnt; adpcm_init( work ); for( cnt=0; cnt<0x4000; cnt++ ) { if(cnt & 1){ adpcm_32[cnt>>1]|=((unsigned char)adpcm_132_enc((int)linear_enc[cnt], work)) << 4; } else{ adpcm_32[cnt>>1]=(unsigned char)adpcm_132_enc((int)linear_enc[cnt], work); } } }
void decoder () { unsigned register int cnt; adpcm_init( work ); for( cnt = 0; cnt<0x4000; cnt++ ){ if(cnt & 1){ linear_dec[cnt] = (short)adpcm_132_dec( ((int)adpcm_32[cnt>>1]) >> 4, work ); } else{ linear_dec[cnt] = (short)adpcm_132_dec( ((int)adpcm_32[cnt>>1]) & 0xf, work ); } } }
main () { encoder(); decoder(); }
49
[MEMO]
50
Facsimile Message
From:
Name Company
Although NEC has taken all possible steps to ensure that the documentation supplied to our customers is complete, bug free and up-to-date, we readily accept that errors may occur. Despite all the care and precautions we've taken, you may encounter problems in the documentation. Please complete this form whenever you'd like to report errors or suggest improvements to us.
Tel.
FAX
Address
Thank you for your kind support.
North America Hong Kong, Philippines, Oceania NEC Electronics Inc. NEC Electronics Hong Kong Ltd. Corporate Communications Dept. Fax: +852-2886-9022/9044 Fax: 1-800-729-9288 1-408-588-6130 Korea Europe NEC Electronics Hong Kong Ltd. NEC Electronics (Europe) GmbH Seoul Branch Technical Documentation Dept. Fax: 02-528-4411 Fax: +49-211-6503-274 South America NEC do Brasil S.A. Fax: +55-11-6465-6829 Taiwan NEC Electronics Taiwan Ltd. Fax: 02-719-5951 Asian Nations except Philippines NEC Electronics Singapore Pte. Ltd. Fax: +65-250-3583
Japan NEC Semiconductor Technical Hotline Fax: 044-548-7900
I would like to report the following error/make the following suggestion: Document title: Document number: Page number:
If possible, please fax the referenced page or drawing. Document Rating Clarity Technical Accuracy Organization
CS 98.2
Excellent
Good
Acceptable
Poor


▲Up To Search▲   

 
Price & Availability of AP703000-B04

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X